import { combineReducers } from 'redux';
// import { routerReducer } from 'react-router-redux';
import { connectRouter } from 'connected-react-router'
import history from './history';
import homeReducer from '../features/home/redux/reducer';
import commonReducer from '../features/common/redux/reducer';
import examplesReducer from '../features/examples/redux/reducer';
import layoutReducer from '../features/layout/redux/reducer';
import generalReducer from '../features/general/redux/reducer';
import regionalEconomyReducer from '../features/regional-economy/redux/reducer';
import specialDataReducer from '../features/special-data/redux/reducer';
import myReducer from '../features/my/redux/reducer';
import adminReducer from '../features/admin/redux/reducer';
import dataAssistantReducer from '../features/data-assistant/redux/reducer';
import carbonEmissionReducer from '../features/carbon-emission/redux/reducer';
import componentReducer from '../features/component/redux/reducer';
import dataReducer from '../features/data/redux/reducer';

// NOTE 1: DO NOT CHANGE the 'reducerMap' name and the declaration pattern.
// This is used for Rekit cmds to register new features, remove features, etc.
// NOTE 2: always use the camel case of the feature folder name as the store branch name
// So that it's easy for others to understand it and Rekit could manage them.

const reducerMap = {
  router: connectRouter(history),
  home: homeReducer,
  common: commonReducer,
  examples: examplesReducer,
  layout: layoutReducer,
  general: generalReducer,
  regionalEconomy: regionalEconomyReducer,
  specialData: specialDataReducer,
  my: myReducer,
  admin: adminReducer,
  dataAssistant: dataAssistantReducer,
  carbonEmission: carbonEmissionReducer,
  component: componentReducer,
  data: dataReducer,
};

export default combineReducers(reducerMap);
